﻿@{
    ViewBag.Title = "登录页面";
}

@section Header{
    <style type="text/css">
        .copyright-aboutlink { color: #cbc8c8; }
    </style>
    <script type="text/javascript">
        $(function () {
            $.util.namespace("window.loginpage");

            var form = $("#loginForm"),
                btnSubmit = $("#btnSubmit"), btnReset = $("#btnReset"), btnClear = $("#btnClear");

            btnSubmit.click(function () {
                form.form("submit", function (data) {
                    if (!data) {
                        return $.easyui.messager.show({ icon: "error", msg: "获取服务器响应数据失败，如果重复出现此问题，请与您的管理员联系!" });
                    }
                    if (data.StatusResult && data.Url) {
                        window.location.href = data.Url;
                    } else {
                        $.easyui.messager.show(data.Message);
                    }
                });
            });

            btnReset.click(function () { form.form("reset"); });

            btnClear.click(function () { form.form("clear"); });

            $("#loginCode").keypress(function (e) {
                if (e.which == 13) { $("#password").focus(); }
            });

            $("#password").keypress(function (e) {
                if (e.which == 13) { $("#captcha").focus(); }
            });

            $("#captcha").keypress(function (e) {
                if (e.which == 13) { btnSubmit.click(); }
            });
        });
    </script>
}

@model NDF.Framework.Models.Views.LoginView

<div style="height: 100%; width: 100%; position: absolute; overflow:hidden;">
    <img alt="" src="/Content/images/loginbg.jpg" style="height:100%; width:100%;" />
</div>

<div style="height: 330px; width: 620px; left: 50%; top: 50%; position: absolute; margin-left: -300px; margin-top: -170px; background: url('/Content/images/loginbox.png') no-repeat center; ">
    <div style="background: url('/Content/images/triangle.png') no-repeat 27px; color: #fff; font-size: 20px; font-weight: bolder; padding-left: 50px;font-family:'YouYuan' ">
        @ViewBag.SystemTitle
    </div>
    <div style="height: 200px; padding: 30px 70px 40px 50px;">
        <div style="float: left; width: 200px; height: 200px;">
            <img alt="" style="height: 120px; width: 120px; margin: 30px 10px 20px 30px" src="~/Content/images/logo.jpg" />
        </div>
        <div style="float: left; border-left: 1px solid #cbc8c8;">
            <div>
                <img alt="" src="/Content/images/loginlock.png" />
                <img alt="" src="/Content/images/userlogin.png" />
            </div>
            <div id="loginForm">
                <table class="infoview-table">
                    <tr class="infoview-table-row">
                        <td class="infoview-table-label">@Html.DisplayNameFor(m => m.LoginCode)：</td>
                        <td class="infoview-table-infocell">
                            @Html.EasyUi().ValidateBoxFor(m => m.LoginCode, new { autoFocus = true, tipPosition = "right" }, new { id = "loginCode" })
                        </td>
                    </tr>
                    <tr class="infoview-table-row">
                        <td class="infoview-table-label">@Html.DisplayNameFor(m => m.Password)：</td>
                        <td class="infoview-table-infocell">
                            @Html.EasyUi().ValidateBoxFor(m => m.Password, new { tipPosition = "right" }, new { id = "password", type = "password" })
                        </td>
                    </tr>
                    <tr class="infoview-table-row">
                        <td class="infoview-table-label">@Html.DisplayNameFor(m => m.Captcha)：</td>
                        <td class="infoview-table-infocell">
                            @Html.EasyUi().ValidateBoxFor(m => m.Captcha, new { width = 60 }, new { id = "captcha" })
                            <img alt="@Html.DisplayNameFor(m => m.Captcha)" title="@Html.DisplayNameFor(m => m.Captcha)"
                                 src=""
                                 style="width: 92px; height: 20px; vertical-align: middle; cursor: pointer; border: 1px solid #c6b4c8;" />
                        </td>
                    </tr>
                    <tr class="infoview-table-row">
                        <td class="infoview-table-infocell infoview-table-infocell-mergecolumn" colspan="2" style="text-align: center; padding-top: 10px;">
                            <a id="btnSubmit" class="easyui-linkbutton" data-options="plain: true, iconCls: 'icon-hamburg-login'">登录</a>
                            <a id="btnReset" class="easyui-linkbutton" data-options="plain: true, iconCls: 'icon-hamburg-settings'">重置</a>
                            <a id="btnClear" class="easyui-linkbutton" data-options="plain: true, iconCls: 'icon-hamburg-cv'">清空</a>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
    <div style="color:#fff;text-align:center;">@Html.Raw(NDF.Framework.SystemEnvironment.Copyright)</div>
</div>